import { Request, Response } from 'express';

export default {
  'GET /_api/order-manage/getTable': getFakeTable,
};


function getFakeTable(req: Request, res: Response) {
  const params = req.query as any;
  const { pageSize = 10 } = params;
  const data = {
    saleOrder: 'SO20202005270002',
    orderType: '箱头销售订单',
    customName: '日立电梯 (上海) 有限公司',
    maker: '侯晓燕',
    status: 'notGenerate',
    datetime: '2019-09-23 13:00:09',
  };
  const result = [] as any;

  for(let i=0; i< pageSize; i++ ){
    result.push(JSON.parse(JSON.stringify(data)));
  }

  result[1].status = 'canceled';
  result[2].status = 'allGenerate';
  result[3].status = 'canceled';
  result[4].status = 'canceled';
  result[5].status = 'allGenerate';

  return res.json(result);


}
